package com.futures.investm.activity;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.aries.ui.view.title.TitleBarView;
import com.bumptech.glide.Glide;
import com.futures.investm.R;

import butterknife.BindView;
import tech.com.commoncore.base.BaseTitleActivity;

public class NewsFlashDetailsActivity extends BaseTitleActivity {


    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_time)
    TextView tvTime;
    @BindView(R.id.tv_content)
    TextView tvContent;
    @BindView(R.id.img)
    ImageView imageView;
    TitleBarView titleBar;
    String titleBarText = "";
    @Override
    public void setTitleBar(TitleBarView titleBar) {
        this.titleBar = titleBar;
    }

    @Override
    public int getContentLayout() {
        return R.layout.activity_news_falsh_details;
    }

    @Override
    public void initView(Bundle savedInstanceState) {

        String i = (String) getIntent().getSerializableExtra("i");

        if (i.equals("0")) {
            titleBarText = "实时资讯";
        } else{
            titleBarText = "快讯详情";
        }
        titleBar.setTitleMainText(titleBarText)
                .setStatusBarLightMode(false);

        String title = (String) getIntent().getSerializableExtra("post_title");
        String time = (String) getIntent().getSerializableExtra("published_time");
        String content = (String) getIntent().getSerializableExtra("post_content");
        String img = (String) getIntent().getSerializableExtra("img");


        Glide.with(mContext).load(img).into(imageView);
        tvTitle.setText(title);
        tvTime.setText(time);
        tvContent.setText(content);

    }
}
